package com.ux.control
{
	import com.ux.manager.StageManager;
	
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.geom.PerspectiveProjection;
	import flash.geom.Point;
	
	
	/**
	 * @author winnie
	 */	
	public class BasicParticle extends Sprite
	{
		
		public function BasicParticle()
		{
			super();
		}
		
		
		private static function makeParticle( data:BitmapData ):Vector.<Bitmap>
		{
			var particleList:Vector.<Bitmap> = new Vector.<Bitmap>();
			
			// 파티클 생성
			for ( var ex:Number = 0;ex < data.width;ex++)
			{
				for (var ey:Number = 0;ey < data.height;ey++)
				{
					var c:uint = data.getPixel(ex,ey);
					var rad:Number = Math.random()*(Math.PI*2);
					var bmd : BitmapData = new BitmapData( 1,1,false,c);
					var bt : Bitmap = new Bitmap( bmd );
					
					particleList.push( bt );
					
					bt.x = ex;
					bt.y = ey;
				}
			}
			
			particleList.fixed = true;
			
			return particleList;
		}
		
		
		
		
		
		private static function throwParticle( w:Number, h:Number, maxDis:Number, pList:Vector.<Bitmap>, pX:Vector.<Number>, pY:Vector.<Number> ):void
		{
			/*
			// 파티클 생성
			for ( var ex:Number = 0;ex < data.width;ex++){
				for (var ey:Number = 0;ey < data.height;ey++){
					var c:uint = data.getPixel(ex,ey);
					if(c != 0x000000)
					{
						var rad:Number = Math.random()*(Math.PI*2);
						var dis:Number = Math.random()*maxDis;
						var bmd : BitmapData = new BitmapData( 1,1,false,c);
						var bt : Bitmap = new Bitmap( bmd );
						
						vecTX.push( ex + centerX );
						vecTY.push( ey + centerY );
						particleList.push( bt );
						addChild( bt );
						
						bt.x = ( ex + centerX ) + dis * Math.cos(rad);
						bt.y = ( ey + centerY ) + dis * Math.sin(rad);
						vecX.push( ( ex + centerX ) + (dis/3) * Math.cos(rad) );
						vecY.push( ( ey + centerY ) + (dis/3) * Math.sin(rad) );
						vecZ.push( dis );
					}
				}
			}*/
		}
	}
}





